﻿using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;

namespace Main.lib.graphics
{

    /*
     * Display
     * 
     * @brief   Draw all the DisplayObjects
     * @version 2011.11.14
     * 
     * @author  Bruno Miguel de Oliveira Tamer <bmotamer@gmail.com>
     */
    public sealed class Graphics
    {

     // Scope                   Type                Name       Value
        public  static readonly int                 Width    = Main.Video.PreferredBackBufferWidth;  //!< Width of the client
        public  static readonly int                 Height   = Main.Video.PreferredBackBufferHeight; //!< Height of the client
        private static          List<DisplayObject> Children = new List<DisplayObject>();            //!< List of DisplayObjects

        /*
         * Add one DisplayObject to the list
         */
        public static void Add(DisplayObject Child)
        {
            Children.Add(Child);
        }

        /*
         * Draw all the DisplayObjects in the list
         */
        public static void Draw(SpriteBatch SpriteBatch)
        {
            foreach (DisplayObject Child in Children)
                Child.Draw(SpriteBatch);
        }

        /*
         * Remove one DisplayObject from the list
         */
        public static void Remove(DisplayObject Child)
        {
            Children.Remove(Child);
        }

    }

}